package com.kintreda.ieco_server.module.api.service.impl;

import com.kintreda.ieco_server.bean.massage.Massage;
import com.kintreda.ieco_server.core.repository.IBaseRepository;
import com.kintreda.ieco_server.core.service.impl.BaseServiceImpl;
import com.kintreda.ieco_server.module.api.service.IMassageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Created by IntelliJ IDEA
 * @Project_Name ieco_server
 * @Package com.kintreda.ieco_server.module.api.service.impl
 * @Author ZhongYao_H
 * @Date 2019/5/12:15:54
 * @Year 2019 Month 05 Day 12
 * @Date_zh 2019 年 五月 星期日
 */
@Service
public class MassageServoiceImpl extends BaseServiceImpl<Massage,String> implements IMassageService {

    @Autowired
    IBaseRepository<Massage,String> massageStringIBaseRepository;

    @Override
    public List<Map<String,Object>> queryMassageByUserId(String userId){
        List<Map<String, Object>> listBySql = massageStringIBaseRepository.findListBySql("select id,title,createDate from massage where destination = ? order by createDate desc limit 0,50 ", new Object[]{userId});
        return listBySql;
        //return query("from Massage where destination = ? order by createDate desc ",new Object[]{userId});
    }

}
